\ProvidesPackage{estilo}



%% LINGUA

\usepackage[english]{babel}  % english
\usepackage[utf8]{inputenc}




%% FORMATACAO

\usepackage{indentfirst}  % indent first paragraph as well
\usepackage{enumitem}     % more enum options
\usepackage[left=3.5cm,right=1.5cm,top=2.5cm,bottom=2.0cm,bindingoffset=-1cm]{geometry}
\usepackage{setspace}     % espaçamento entre paragrafos
\onehalfspacing
%\renewcommand{\arraystretch}{1}  % tables smaller paragraph spacing
\setlength{\tabcolsep}{5pt}  % shorter table-column spacing



\setlist{noitemsep}   % menos espaço nas listas
\renewcommand{\@listI}{%
\leftmargin=25pt
\rightmargin=0pt
\labelsep=5pt
\labelwidth=20pt
\itemindent=0pt
\listparindent=0pt
\topsep=8pt plus 2pt minus 4pt  % espaço em cima e baixo
\partopsep=0pt plus 1pt minus 1pt
\parsep=0pt plus 1pt
\itemsep=\parsep}




% CABEÇALHO

% Cabeçalho e rodapé
\usepackage{fancyhdr}                      % Controlar os cabeçalhos e rodapés
\pagestyle{fancy}                          % Usar os estilos do pacote fancyhdr
\fancypagestyle{}
\fancyhf{}                                 % Limpar os campos do cabeçalho atual
\fancyhead[R]{\scriptsize \begin{tabular}{r|c}
FCUP & \thepage \\ 
\@title & \\
\end{tabular}}
\fancyfoot[]{}
\renewcommand{\headrulewidth}{0pt} % retirando linha

\fancypagestyle{plain}


%% COMANDOS EXTRA

\usepackage{fixltx2e}  % command \textsubscript
\usepackage{amsmath}   % \text nas equacoes
\usepackage{tabularx}  % table column expand X
\usepackage{booktabs}  % \midrule and other tabular opts
\usepackage[table]{xcolor} % table alternating \rowcolors
\usepackage{minibox}   % minipage without specific width
\usepackage{multicol}  % \begin{multicol}{2} environment
\usepackage{amsfonts}  % \checkmark symbol
\usepackage{wrapfig}   % \begin{wrapfigure}[lineheight]{position}{width}
\usepackage{subcaption}% \begin{subfigure}
\usepackage{tabu}      % \begin{longtable}
\usepackage[
	separate-uncertainty=true,
	multi-part-units=single,
	range-units=single]
	{siunitx} % \SI{}{} unidades

\setlength{\intextsep}{0pt}  % wrapfig padding properties
%\setlength{\columnsep}{0pt}

%% LISTAGEM CODIGO E ALGORITMOS

\usepackage{listings}
\lstset{
	language=R, basicstyle=\footnotesize,
	numbers=left, numberstyle=\tiny, numbersep=2pt,
	tabsize=2, breaklines=true, breakatwhitespace=false,
	keywordstyle=\bfseries, commentstyle=\color{gray},
	stringstyle=\itshape, escapeinside={(*@}{@*)}
}
\usepackage{algorithm,algorithmic}






%% REFERENCIAS

\usepackage{shorttoc}  % indice mais curto; tem que vir antes que hyperref

\usepackage{csquotes}  % silence warning
\usepackage[
	backend=biber,
	natbib=true,
	backref=true,
	doi=true,
	url=false,
	style=authoryear,
	citestyle=authoryear,
%	refsection=chapter
	]{biblatex}
\addbibresource{library.bib}
\usepackage[colorlinks=true,citecolor=blue]{hyperref}  % links -- depois do biber / antes de makeindex



%% GLOSSARIO

\newcommand{\newdualentry}[4] {
	\newglossaryentry{#1g} {
	  name={#2},
	  plural={#3},
	  description={#4},
	}
	\newacronym[\glslongpluralkey={#3},see={[Glossary:]{#1g}}]{#1}{#1}{#2\glsadd{#1g}}%
}

% 2em1: glossary and acronymous
% http://en.wikibooks.org/wiki/LaTeX/Glossary
\usepackage[acronym,toc,nopostdot]{glossaries}
\makeglossaries
\loadglsentries{glossario.tex}
\defglsentryfmt{\color{black}\bfseries\glsgenentryfmt}
\defglsentryfmt[acronym]{\color{black}\bfseries\glsgenentryfmt}




%% DIAGRAMAS

\usepackage{tikz}
\usetikzlibrary{
	fit,
	positioning,
	shapes.multipart,
	arrows,
	arrows.meta,
	decorations.pathreplacing,
	calc,
	shapes.geometric,
	matrix}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}





%% MACROS

\newcommand{\belongs}[2] {  % \belongs
\noindent
\[
{\renewcommand{\arraystretch}{.7} \minibox{#1}}
\left \{
\minibox{#2}
\right .
\]%
}
